package com.ttbj.move_rule.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.ttbj.move_rule.dao.BillPieceMapper;
import com.ttbj.move_rule.po.BillPiece;
import com.ttbj.move_rule.service.MoveBillStrategy;
import com.ttbj.product.api.DriverFacade;

@Component
public class PieceMoveBillStrategy implements MoveBillStrategy {

	@Autowired
	BillPieceMapper pieceRuleMapper = null;

	@Autowired
	DriverFacade driverFacade = null;

	@Override
	public Float strategyInterface(Integer billType, String senderLat, String senderLng, String reciverLat, String reciverLng, Integer floorNum, Integer pieceNum, Integer baleNum, String truckType, Integer serciveLevel,Integer orderDriverRequire) throws Exception {
		BillPiece rule = pieceRuleMapper.selectByPrimaryKey(1);//每次取出首条信息
		Float piecePrice = rule.getPiecePrice();
		piecePrice = null  == piecePrice ? 0f : piecePrice;
		pieceNum = null == pieceNum ? 0 :pieceNum;
		return pieceNum *piecePrice;
	}

}
